//
//  LYScheduleTableViewCell.m
//  SZBank
//
//  Created by LuoYao on 16/7/22.
//  Copyright © 2016年 LuoYao. All rights reserved.
//

#import "LYScheduleTableViewCell.h"


@interface LYScheduleTableViewCell ()
@property (nonatomic) UILabel *dateLbale;/**< 开始时间和结束时间 */
@property (nonatomic) UILabel *titleLabel;/**< 事件标题 */
@end
@implementation LYScheduleTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self addSubview:self.dateLbale];
        [self addSubview:self.titleLabel];
    }
    return self;
}




#pragma mark - getter
- (UILabel *)dateLbale{
    if (!_dateLbale) {
        _dateLbale = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, KWIDTH * 0.5, 30)];
        _dateLbale.font = [UIFont systemFontOfSize:FONT_SIZE];
        _dateLbale.backgroundColor = [UIColor colorWithRed:0.0715 green:0.5951 blue:0.0136 alpha:1.0];
    }
    return _dateLbale;
}


- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.dateLbale.frame), KWIDTH * 0.5, 70)];
        _titleLabel.font = [UIFont systemFontOfSize:FONT_SIZE];
        _titleLabel.backgroundColor = [UIColor colorWithRed:0.9452 green:0.9452 blue:0.9452 alpha:1.0];
    }
    return _titleLabel;
}

- (void)setDic:(NSDictionary *)dic{
    self.dateLbale.text = [NSString stringWithFormat:@"%@ - %@",dic[@"startDate"],dic[@"endDate"]];
    self.titleLabel.text = dic[@"title"];
}
@end
